Optimal. Leaf size=82 \[ \frac {3 x}{8 a}-\frac {i}{8 d (a-i a \tan (c+d x))}+\frac {i a}{8 d (a+i a \tan (c+d x))^2}+\frac {i}{4 d (a+i a \tan (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3568, 46, 212}
\begin {gather*} \frac {i a}{8 d (a+i a \tan (c+d x))^2}-\frac {i}{8 d (a-i a \tan (c+d x))}+\frac {i}{4 d (a+i a \tan (c+d x))}+\frac {3 x}{8 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 46
Rule 212
Rule 3568
Rubi steps
\begin {align*} \int \frac {\cos ^2(c+d x)}{a+i a \tan (c+d x)} \, dx &=-\frac {\left (i a^3\right ) \text {Subst}\left (\int \frac {1}{(a-x)^2 (a+x)^3} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {\left (i a^3\right ) \text {Subst}\left (\int \left (\frac {1}{8 a^3 (a-x)^2}+\frac {1}{4 a^2 (a+x)^3}+\frac {1}{4 a^3 (a+x)^2}+\frac {3}{8 a^3 \left (a^2-x^2\right )}\right ) \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {i}{8 d (a-i a \tan (c+d x))}+\frac {i a}{8 d (a+i a \tan (c+d x))^2}+\frac {i}{4 d (a+i a \tan (c+d x))}-\frac {(3 i) \text {Subst}\left (\int \frac {1}{a^2-x^2} \, dx,x,i a \tan (c+d x)\right )}{8 d}\\ &=\frac {3 x}{8 a}-\frac {i}{8 d (a-i a \tan (c+d x))}+\frac {i a}{8 d (a+i a \tan (c+d x))^2}+\frac {i}{4 d (a+i a \tan (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.33, size = 78, normalized size = 0.95 \begin {gather*} -\frac {-7+12 i d x+2 \cos (2 (c+d x))+3 i \sec (c+d x) \sin (3 (c+d x))+6 i \tan (c+d x)-12 d x \tan (c+d x)}{32 a d (-i+\tan (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.42, size = 75, normalized size = 0.91
method | result | size |
risch | \(\frac {3 x}{8 a}+\frac {i {\mathrm e}^{-4 i \left (d x +c \right )}}{32 d a}+\frac {i \cos \left (2 d x +2 c \right )}{8 d a}+\frac {\sin \left (2 d x +2 c \right )}{4 d a}\) | \(61\) |
derivativedivides | \(\frac {-\frac {3 i \ln \left (\tan \left (d x +c \right )-i\right )}{16}-\frac {i}{8 \left (\tan \left (d x +c \right )-i\right )^{2}}+\frac {1}{4 \tan \left (d x +c \right )-4 i}+\frac {3 i \ln \left (\tan \left (d x +c \right )+i\right )}{16}+\frac {1}{8 \tan \left (d x +c \right )+8 i}}{d a}\) | \(75\) |
default | \(\frac {-\frac {3 i \ln \left (\tan \left (d x +c \right )-i\right )}{16}-\frac {i}{8 \left (\tan \left (d x +c \right )-i\right )^{2}}+\frac {1}{4 \tan \left (d x +c \right )-4 i}+\frac {3 i \ln \left (\tan \left (d x +c \right )+i\right )}{16}+\frac {1}{8 \tan \left (d x +c \right )+8 i}}{d a}\) | \(75\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 54, normalized size = 0.66 \begin {gather*} \frac {{\left (12 \, d x e^{\left (4 i \, d x + 4 i \, c\right )} - 2 i \, e^{\left (6 i \, d x + 6 i \, c\right )} + 6 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i\right )} e^{\left (-4 i \, d x - 4 i \, c\right )}}{32 \, a d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.16, size = 151, normalized size = 1.84 \begin {gather*} \begin {cases} \frac {\left (- 512 i a^{2} d^{2} e^{8 i c} e^{2 i d x} + 1536 i a^{2} d^{2} e^{4 i c} e^{- 2 i d x} + 256 i a^{2} d^{2} e^{2 i c} e^{- 4 i d x}\right ) e^{- 6 i c}}{8192 a^{3} d^{3}} & \text {for}\: a^{3} d^{3} e^{6 i c} \neq 0 \\x \left (\frac {\left (e^{6 i c} + 3 e^{4 i c} + 3 e^{2 i c} + 1\right ) e^{- 4 i c}}{8 a} - \frac {3}{8 a}\right ) & \text {otherwise} \end {cases} + \frac {3 x}{8 a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.54, size = 99, normalized size = 1.21 \begin {gather*} -\frac {\frac {6 i \, \log \left (i \, \tan \left (d x + c\right ) + 1\right )}{a} - \frac {6 i \, \log \left (i \, \tan \left (d x + c\right ) - 1\right )}{a} + \frac {2 \, {\left (3 \, \tan \left (d x + c\right ) + 5 i\right )}}{a {\left (-i \, \tan \left (d x + c\right ) + 1\right )}} + \frac {-9 i \, \tan \left (d x + c\right )^{2} - 26 \, \tan \left (d x + c\right ) + 21 i}{a {\left (\tan \left (d x + c\right ) - i\right )}^{2}}}{32 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.45, size = 60, normalized size = 0.73 \begin {gather*} \frac {3\,x}{8\,a}-\frac {\frac {3\,{\mathrm {tan}\left (c+d\,x\right )}^2}{8}-\frac {\mathrm {tan}\left (c+d\,x\right )\,3{}\mathrm {i}}{8}+\frac {1}{4}}{a\,d\,{\left (1+\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^2\,\left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________